import { Login } from '../index'
import { setToken } from '@/utils/token'

export async function register(data) {
    try {
        await Login.register(data);
    } catch (error) {
        console.log(error);
    }
}

export async function email(data) {
    try {
        await Login.email(data);
    } catch (error) {
        console.log(error);
    }
}

export async function login(data) {
    try {
        const response = await Login.login(data);
        const token = response.data.token;
        setToken('token', token);
    } catch (error) {
        console.log(error);
    }
}